package com.hanggold.file;

import java.io.File;
import java.io.IOException;

/**
 * @author <a href="mailto:sunmch@163.com">smc</a>
 * @date 2019-07-19 16:32
 * @since
 **/
public class DemoCreateFile {

    public static void main(String[] args) {

        try {
            File tempDir =  File.createTempFile("smc.","tmp");

            tempDir.delete();

            tempDir.mkdir();

            //当程序停止的时候自动删除
            tempDir.deleteOnExit();

        } catch (IOException e) {
            e.printStackTrace();
        }


    }

}
